import { Component, ElementRef, Renderer2 } from '@angular/core';
import { ApesField } from './apes-field';
import { Events } from '@core/services/events/Events';
import { ExpressionService } from '@core/services/expression/ExpressionService';
import { SubjectService } from '@core/services/events/subject.service';
import { ApiService } from '@core/services/http/api.service';

@Component({
  selector: 'formly-field-upload-form',
  template: `
    <upload-form [formControl]="formControl"
                 [disabled]="to.disabled"
                 [showDownload]="to.showDownload"
                 [title]="to.label"
                 [limit]="to.limit"
                 [showRemove]="to.showRemove">
    </upload-form>
  `,
  host: {},
})


export class FormlyFieldUploadForm extends ApesField {
  constructor(protected apiService: ApiService, protected events: Events, protected expressionService: ExpressionService, protected subject: SubjectService,
              protected elementRef: ElementRef, protected renderer: Renderer2) {
    super(apiService, events, expressionService, subject);

  }

  getDisabled() {
    return this.to.disabled ? true : false;
  }

}
